//
//  AppManager.h
//  PurchasingMeeting
//
//  Created by zhuang yihang on 7/10/13.
//  Copyright (c) 2013 YX. All rights reserved.
//

#import <Foundation/Foundation.h>

#import "DataManager.h"

/*
 该类保存了一些app的设定，如，数据缓存目录等信息
 */
@interface AppManager : NSObject

+ (AppManager *)sharedManager;

- (NSString *)getDatabasePath;
- (NSString *)getImagePath;
- (NSString *)getBundleDatabasePath;
- (NSString *)getImageFolder;

//启动自动更新服务器数据进程
- (void)startAutoUpdateSession;
//启动自动提交订单数据进程
- (void)startAutoSubmitSession;

- (void)stopAutoUpdate;
- (void)stopAutoSubmit;
- (void)resumeAutoSubmitSession;
- (void)pauseAutoSubmitSession;
- (void)resumeAutoUpdateSession;
- (void)pauseAutoUpdateSession;

- (void)resetAutoSubmitSession;
- (void)resetAutoUpdateSession;


- (void)updateDatabase;

//设置自动更新数据时间
- (void)setUpdateInterval:(float)seconds;
//设置自动提交订单时间
- (void)setSubmitInterval:(float)seconds;
- (void)submitOrder;

- (BOOL)getSubmitStatus;
- (void)setOrderIndex:(int)index;
- (void)setSubmitStatus:(BOOL)status;
- (void)submit:(DMCompletion)completion;
- (void)submitByShopID:(NSString *)shopid completion:(DMCompletion)completion;

- (void)forceUpdate:(DMCompletion)completion;

- (void)forceSubmitOrder:(DMCompletion)completion;
- (void)forceSubmitAllOrder:(DMCompletion)completion;

@end
